﻿<Window x:Class="MvvmLightSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ignore="http://www.ignore.com"
        xmlns:vm="clr-namespace:MvvmLightSample.ViewModel"
        xmlns:v="clr-namespace:MvvmLightSample"
        mc:Ignorable="d ignore"
        Height="250"
        Width="400"
        Title="MVVM Light with Utils"
        DataContext="{Binding Main, Source={StaticResource Locator}}" WindowStartupLocation="CenterScreen" MinWidth="100" MinHeight="100">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock
            Grid.Row="0"
            Margin="5"
            FontSize="26"
            FontWeight="Bold"
            Foreground="Purple"
            Text="{Binding WelcomeTitle}"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            TextWrapping="Wrap" />

        <v:PersonView Grid.Row="1" Margin="5" />

        <Button
            Grid.Row="2"
            Margin="5"
            Command="{Binding AddPerson}">
            Add person!
        </Button>

        <DataGrid 
            Grid.Row="3"
            Margin="5"
            IsReadOnly="True"
            AutoGenerateColumns="False"
            ItemsSource="{Binding People}">
            <DataGrid.Columns>
                <DataGridTextColumn Width="*" Header="Name" Binding="{Binding Name}" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>